package com.wantupai.mvp.mvp.lce.animcator;

import android.view.View;

/**
 * @author :Created by zhangqing on 2018/11/26 13:45
 * @description :
 * @email :1423118197@qq.com
 * @classpath : com.football.wealth.mvp.mvp.lce.animcator.MvpAnimatorUitls
 */
public class MvpAnimatorUitls {
    private static MvpAnimatorUitls instance;

    public static MvpAnimatorUitls getInstance() {
        if (instance == null) {
            synchronized (MvpAnimatorUitls.class) {
                if (instance == null) {
                    instance = new MvpAnimatorUitls();
                }
            }
        }
        return instance;
    }

    private MvpAnimatorUitls() {

    }

    public void showContent(View loadingView, View contentView, View errorView, View defaultView) {
        loadingView.setVisibility(View.GONE);
        contentView.setVisibility(View.VISIBLE);
        errorView.setVisibility(View.GONE);
        defaultView.setVisibility(View.GONE);
    }

    public void showError(View loadingView, View contentView, View errorView, View defaultView) {
        loadingView.setVisibility(View.GONE);
        contentView.setVisibility(View.GONE);
        errorView.setVisibility(View.VISIBLE);
        defaultView.setVisibility(View.GONE);
    }

    public void showLoading(View loadingView, View contentView, View errorView, View defaultView) {
        loadingView.setVisibility(View.VISIBLE);
        contentView.setVisibility(View.GONE);
        errorView.setVisibility(View.GONE);
        defaultView.setVisibility(View.GONE);
    }

    public void showDefaultPage(View loadingView, View contentView, View errorView, View defaultView) {
        loadingView.setVisibility(View.GONE);
        contentView.setVisibility(View.GONE);
        errorView.setVisibility(View.GONE);
        defaultView.setVisibility(View.VISIBLE);
    }
}
